package test;

import java.util.Arrays;

public class ArrayDemo {
    public static void main(String[] args) {
        int arr1[]={1,2,3,4,5,6,7};
        int arr2[]={};
        int j=0;
        System.out.println(arr2.length);
        for (int i = 0; i < arr1.length; i++) {
            if(arr1[i]%2==0){
                arr2[j]=arr1[i];
                j++;
            }
        }
        System.out.println(Arrays.toString(arr2));
    }
}
